home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / dragonball-kart.swf / scripts / frame_21 / PlaceObject2_338_990 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2011-10-17  |  5.4 KB  |  205 lines

  1. onClipEvent(enterFrame){
  2.    if(kena == 1)
  3.    {
  4.       if(ben == 0)
  5.       {
  6.          ben = 1;
  7.          _root.efek2.attachSound("hit");
  8.          _root.efek2.setVolume(100);
  9.          _root.efek2.start();
  10.       }
  11.       k++;
  12.       trace(k);
  13.       if(k >= 24)
  14.       {
  15.          ben = 0;
  16.          trace("D");
  17.          k = 0;
  18.          kena = 0;
  19.          ssp = 5;
  20.          this.kar.char.gotoAndStop(1);
  21.       }
  22.    }
  23.    if(fini == 1)
  24.    {
  25.       _X = _X + 10;
  26.       if(_Y < 240)
  27.       {
  28.          _Y = _Y + gravity;
  29.          gravity += 1;
  30.       }
  31.       else
  32.       {
  33.          _Y = 240;
  34.       }
  35.       _Y = _Y + 3;
  36.    }
  37.    if(pauss != 1)
  38.    {
  39.       trace("saya1" + _Y);
  40.       p = 1;
  41.       while(p <= 4)
  42.       {
  43.          if(_root["org" + p]._x - _root.org1._x >= _root.fastfood)
  44.          {
  45.             divr = 5;
  46.          }
  47.          else if(_root["org" + p]._x - 30 - _root.org1._x <= 0)
  48.          {
  49.             divr = 0;
  50.          }
  51.          p++;
  52.       }
  53.       if(this.tari.hitTest(_root.gor.fin) and fini != 1)
  54.       {
  55.          _root.efek3.attachSound("finish");
  56.          _root.efek3.setVolume(100);
  57.          _root.efek3.start();
  58.          _root.finij.gotoAndStop(2);
  59.          _root.allstop = 1;
  60.          _root.juara[_root.noj] = _root.nowchar;
  61.          trace(_root.juara[_root.noj]);
  62.          _root.noj = _root.noj + 1;
  63.          gravity = 10;
  64.          pauss = 1;
  65.          fini = 1;
  66.       }
  67.       if(_root.kame == 1)
  68.       {
  69.          kamecharge++;
  70.          _root.uis.en.bb._x += 126 / bani;
  71.          if(kamecharge >= bani)
  72.          {
  73.             _root.uis.mw._visible = 1;
  74.             _root.kame = 0;
  75.             kamecharge = 0;
  76.          }
  77.       }
  78.       if(Key.isDown(32) and _root.kame != 1 and jumping != true)
  79.       {
  80.          _root.uis.mw._visible = 0;
  81.          _root.uis.en.bb._x = -63;
  82.          this.kar.char.gotoAndStop(4);
  83.          kameh = 1;
  84.          _root.kame = 1;
  85.       }
  86.       if(Key.isDown(13) and _root["bonus" + _root.bonus] != 1 and _root.bonus != 0 and jumping != true)
  87.       {
  88.          switch(_root.bonus)
  89.          {
  90.             case 1:
  91.                this.kar.char.gotoAndStop(2);
  92.                _root.boost = 5;
  93.                _root["bonus" + _root.bonus] = 1;
  94.                break;
  95.             case 2:
  96.                this.attachMovie("shil" + codenum2,"shil",3);
  97.                _root.efek2.attachSound("kebal");
  98.                _root.efek2.setVolume(100);
  99.                _root.efek2.start();
  100.                this.shields = 1;
  101.                _root["bonus" + _root.bonus] = 1;
  102.                break;
  103.             case 3:
  104.                if(jumping == false)
  105.                {
  106.                   _root["bonus" + _root.bonus] = 1;
  107.                   _root.tottai = _root.tottai + 1;
  108.                   _root.efek2.attachSound("obs");
  109.                   _root.efek2.setVolume(100);
  110.                   _root.efek2.start();
  111.                   _root.attachMovie("tai","tai" + _root.tottai,100 + _root.tottai);
  112.                   _root["tai" + _root.tottai]._x = _X;
  113.                   _root["tai" + _root.tottai]._y = _Y + 15;
  114.                   _root["tai" + _root.tottai].onEnterFrame = function()
  115.                   {
  116.                      if(_root.org1.spon != 0)
  117.                      {
  118.                         this._x -= spon;
  119.                      }
  120.                      t = 1;
  121.                      while(t <= 4)
  122.                      {
  123.                         if(this.hitTest(_root["org" + t]) and t != codenum)
  124.                         {
  125.                            if(_root["org" + t].shields != 1)
  126.                            {
  127.                               _root["org" + t].ssp = 0;
  128.                               _root["org" + t].kena = 1;
  129.                               _root["org" + t].k = 0;
  130.                               _root["org" + t].kar.char.gotoAndStop(3);
  131.                               this.removeMovieClip();
  132.                               break;
  133.                            }
  134.                            this.removeMovieClip();
  135.                         }
  136.                         t++;
  137.                      }
  138.                   };
  139.                }
  140.                break;
  141.             case 4:
  142.                _root.jumplit = 5;
  143.                _root["bonus" + _root.bonus] = 1;
  144.          }
  145.          _root.bonus = 0;
  146.          _root.bot.gotoAndStop(1);
  147.       }
  148.       falling = move(0,5 + vary);
  149.       if(vary < 10 && falling == true)
  150.       {
  151.          vary += 0.5;
  152.       }
  153.       else if(falling == false)
  154.       {
  155.          vary = 0;
  156.       }
  157.       if(Key.isDown(38) && !falling && !jumping)
  158.       {
  159.          _root.efek.attachSound("jump");
  160.          _root.efek.setVolume(100);
  161.          _root.efek.start();
  162.          jumpc = 0;
  163.          jumping = true;
  164.          vel = -16 - _root.jumplit;
  165.          _root.jumpSound.gotoAndPlay(2);
  166.       }
  167.       if(Key.isDown(39))
  168.       {
  169.          if(jumping == false)
  170.          {
  171.             bo = 5;
  172.          }
  173.       }
  174.       else if(jumping == false)
  175.       {
  176.          bo = 0;
  177.       }
  178.       if(pauss != 1)
  179.       {
  180.          if(kena != 1)
  181.          {
  182.             spon = ssp + bo + _root.boost + divr;
  183.             move(spon,0);
  184.          }
  185.       }
  186.       if(jumping)
  187.       {
  188.          isReady = false;
  189.          if(vel <= 0)
  190.          {
  191.             h = move(0,vel - 5);
  192.             if(h == false && vel < 0)
  193.             {
  194.                vel *= -16;
  195.             }
  196.             vel++;
  197.          }
  198.          else
  199.          {
  200.             jumping = false;
  201.          }
  202.       }
  203.    }
  204. }
  205.